package com.itheima.mybatis.test.service.impl;

import com.itheima.mybatis.test.dao.UserMapper;
import com.itheima.mybatis.test.pojo.User;
import com.itheima.mybatis.test.service.UserService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 * @author ：seanyang
 * @date ：Created in 2020/6/19
 * @description ：
 * @version: 1.0
 */
@Service
public class UserServiceImpl implements UserService {

  //@Autowired
  private UserMapper userMapper;

	public UserServiceImpl(){
		System.out.println("UserServiceImpl 无参构造方法...");
	}
	@Override
	public List<User> findUserList() {
	  System.out.println("UserServiceImpl-findUserList userMapper.findAllUsers()");
    return  userMapper.findAllUsers();
	}
	@Override
	public User findUserByUsername(String username) {
    System.out.println("UserServiceImpl-findUserByUsername userMapper.findUserByUsername()");
    return userMapper.findByUsername(username);
	}

}
